package com.yxplearn.mybatisplus.match;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class MatchController {

    @Autowired
    MatchQueueManager matchQueueManager;

    @RequestMapping(value = "/addMatch", method = RequestMethod.GET)
    @ResponseBody
    public void addMatchQueue(@RequestParam("id") Integer id, @RequestParam("name") String name, @RequestParam("address") String address) {
        matchQueueManager.addQueue(new Player(id, name, address));
    }

    @RequestMapping(value = "/cancelMatch", method = RequestMethod.GET)
    @ResponseBody
    public void cancelMatch(@RequestParam("id") Integer id) {
        matchQueueManager.cancelMatch(id);
    }
}
